﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace BOSS.Web
{
    /// <summary>
    /// HttpRequest 的静态扩展
    /// </summary>
    public static class HttpRequestExtensions
    {
        /// <summary>
        /// 判断该 HTTP 请求是否使用 POST 方法
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static bool IsPost(this HttpRequest request)
        {
            return request.HttpMethod == "POST";
        }

        /// <summary>
        /// 判断该 HTTP 请求是否使用 POST 方法
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static bool IsPost(this HttpRequestBase request)
        {
            return request.HttpMethod == "POST";
        }
    }
}
